// needs a fast ruke parser here
// need to create one in js

var EventState = {

    AfterDown: 1,
    AfterUp: 2,
    InDrag: 4,
    FlickFired: 8
};

var EventType = {

    Down: 1,
    Up: 2,
    DblClick: 4,
    Drag: 8,
    Click: 16
};

function Event(params) {

    this.elem = params.elem;
    this.state = params.state;

    this.stm = StateMachine.CreateDefault().WithHandler(this).WithRules(Event.utils.rules).Initialize();
};
Event.utils = {
    rules: {}
};
Event.prototype.process = function(eventType) {
    this.stm.process(eventType);
};

Event.prototype.handle = function (params) {

};
Event.prototype.eventComparor = function(src) {
    return this.elem.eStr.indexOf(">" + src + "<<") != -1;
};
Event.prototype.actionProcessor = function (src) {
    return this.elem.eStr.indexOf(">" + src + "<<") != -1;
};